package com.appkubes.mall.admin.application.admin.admin.controller;

import com.appkubes.cloud.config.params.paramValid.ParamValid;
import com.appkubes.common.Response;
import com.appkubes.mall.admin.application.admin.admin.entity.vo.AdminGetVO;
import com.appkubes.mall.admin.application.admin.admin.service.AdminService;
import com.appkubes.mall.core.entity.MallAdmin;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: Rongjie
 * @Date: 2020/1/12 17:30
 * @Description: 用户信息管理
 */
@Api(tags = "后台用户接口")
@RestController
@RequestMapping("/admin")
public class AdminController {
    @Resource
    AdminService adminService;

    //获取管理员个人信息
    @ApiOperation(("获取管理员信息"))
    @GetMapping("/get")
    public Response get(@ParamValid AdminGetVO adminGetVO) {
        System.out.println("sdfa");
        MallAdmin admin = adminService.getAdminDao().selectByUserName(adminGetVO.getAppKey(), adminGetVO.getUserName());
        return Response.success(admin);
    }

    @RequestMapping("/test")
    public Response test() {
        return Response.success("111asdf");
    }
}
